from itertools import count

def tr(list,num):
    if num >= len(list)-1 or num < 0:
        print("索引超出范围")
        return -1
    else:
        return list[num]

# var = [1, 2, 33, 22, 44, 55, 11, 22]
# print(var)
# li = input("请输入索引")
# li = int(li)
# print(tr(var,li))

# def add(nub):
#     a = 0
#     for i in range(0,nub+1):
#         a += i
#     return a
# print(add(300))

测试部 = ['小明','小张','小黄','小杨']
研发部 = ['小黄','小李','小王','小杨','小周']
市场部 = ['小杨','小张','小吴','小冯','小周']

counter = {}
def maxlen(a,b,c):
    return max(len(a),len(b),len(c))
ma = maxlen(测试部,研发部,市场部)
cou = []
for i in range(0,ma):
    if i < len(测试部):#所有人部门数
# cc = 0
# for i in range(0,len(cou)):
#     if cou[i] in counter:
#         counter[cou[i]] += 1
#     else:
#         counter[cou[i]] = 1
# for key,value in counter.items():
#     if counter[key] > 1:
#         continue
#     else:
#         cc += 1
# print(counter,cc)#所有人部门数
# # cc = 0
# # for i in range(0,len(cou)):
# #     if cou[i] in counter:
# #         counter[cou[i]] += 1
# #     else:
# #         counter[cou[i]] = 1
# # for key,value in counter.items():
# #     if counter[key] > 1:
# #         continue
# #     else:
# #         cc += 1
# # print(counter,cc)
        cou.append(测试部[i])
    else:
        pass
    if i < len(研发部):
        cou.append(研发部[i])
    else:
        continue
    if i < len(市场部):
        cou.append(市场部[i])
    else:
        continue
# print(cou)

#1统计
# for i in range(0,len(cou)):
#     counter[i] = cou[i]
# print(len(counter))
#2所有人部门数
# cc = 0
# for i in range(0,len(cou)):
#     if cou[i] in counter:
#         counter[cou[i]] += 1
#     else:
#         counter[cou[i]] = 1
# for key,value in counter.items():
#     if counter[key] > 1:
#         continue
#     else:
#         cc += 1
# print(counter,cc)

#3两个部门及以上的人
# for i in range(0,len(cou)):
#     if cou[i] in counter:
#         counter[cou[i]] += 1
#     else:
#         counter[cou[i]] = 1
# for key,value in counter.items():
#     if counter[key] > 1:
#         print(key)

# 乘法表倒序打印
a = 10

for i in range(1,10):
    a -= 1
    b = 10
    for j in range(i,10):
        b -= 1
        if j == 9:
            print(a,"x",b,"=",(a*b))
        else:
            print(a, "x", b,"=",(a * b), end='   ')




